function dlogchix = diffeqchi(s,logchix,p)

%disp([(1-s)*10^10 logchix']);

% variables: logchix(1)=log(chi), logchix(2)=x

% differential equations
dlogchi = p.lambda*(p.m + 2*p.n*s + p.a*logchix(2));

if p.labor == "new"
    dx = labornew(s)*exp(logchix(1))/exp((p.lambda-1)*loglaborprod(s,logchix(2),p));
else
    dx = exp(logchix(1))/exp((p.lambda-1)*loglaborprod(s,logchix(2),p));
end

% stack results
dlogchix = [dlogchi; dx];

end